package com.gjy.sb.config;

import com.gjy.sb.interceptor.AInterceptor;
import com.gjy.sb.interceptor.BInterceptor;
import com.gjy.sb.interceptor.SemaphoreInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @author gjy
 * @version 1.0
 * @since 2025-06-04 17:22:46
 */
@Configuration
public class CustomInterceptorConfig implements WebMvcConfigurer {

    @Resource
    private AInterceptor aInterceptor;
    @Resource
    private BInterceptor bInterceptor;
    @Resource
    private SemaphoreInterceptor semaphoreInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        /*registry.addInterceptor(aInterceptor)
                .addPathPatterns("/interceptor/**");
        registry.addInterceptor(bInterceptor)
                .addPathPatterns("/interceptor/**");*/
        registry.addInterceptor(semaphoreInterceptor).addPathPatterns("/**");

    }

}
